package main

func minSwaps(s string) int {
	count := 0
	for i := 0; i < len(s); i++ {
		if s[i] == '[' {
			count++
		} else {
			if count > 0 {
				count--
			}
		}
	}
	if count%2 == 0 {
		return count / 2
	}
	return 1 + count/2
}
func main() {

}
